package com.twu.biblioteca.operation;

import com.twu.biblioteca.customer.Customer;
import com.twu.biblioteca.library.Library;

import java.util.Scanner;

public class LendBookMenuOperation implements MenuOperation {
    @Override
    public String execute(Library library, Customer customer) {
	    if(customer.getName().equals("")){
		    return "please login first.";
	    }
	    Scanner scanner = new Scanner(System.in);
	    if(library.lendBook(scanner.nextInt(),customer)){
		    return "Thank You! Enjoy the book.";
	    }else{
			return "Sorry we don't have that book yet.";
	    }
    }
}
